'use strict'

var http = require('http');
var https = require('https');
var fs = require('fs');
var express = require('express');
var serveIndex = require('serve-index');

//http server
var app = express();
app.use(serveIndex('./public'));//浏览目录
app.use(express.static('./public'));//发布目录

var http_server = http.createServer(app);
http_server.listen(8099, '0.0.0.0');

//https server
var options = {
    key: fs.readFileSync('./cert/server-key.pem'),
    cert: fs.readFileSync('./cert/server-cert.pem')
}
var https_server = https.createServer(options, app);
https_server.listen(8199, '0.0.0.0');